package org.fududu.oauth2;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.io.Serializable;

/**
 * The oauth2.0 protocol access_token model structure.
 *
 * @author Fuchun
 * @since 1.0
 */
public interface AccessToken extends Serializable {

    /**
     * Default access token type: {@code Bearer}
     */
    String DEFAULT_TOKEN_TYPE = "Bearer";

    /**
     * Return the access token issued by the authorization server.
     */
    @NotNull
    String getAccessToken();

    /**
     * Return the lifetime in seconds of the access token.
     */
    @NotNull
    Long getExpiresIn();

    /**
     * Return the type of the token issued as described in.
     */
    @Nullable
    String getTypeToken();

    /**
     * Return the scope of the access token as described by.
     */
    @Nullable
    String getScope();

    /**
     * Return an opaque value used by the client to maintain state between the request and callback.
     */
    @Nullable
    String getState();

    /**
     * Returns the authorized refresh_token.
     */
    @Nullable
    String getRefreshToken();
}
